package com.seecen.cywbackend.controller;

import com.seecen.cywbackend.service.LikeService;
import com.seecen.cywbackend.utils.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/like")
public class LikeController {
    @Resource
    private LikeService likeService;

    @PostMapping("/dynamic")
    public Result dynamicLike(@RequestParam Integer dynamicId,
                             @RequestHeader String uid) {
        Long userId = Long.parseLong(uid);
        return likeService.dynamicLike(userId, dynamicId);
    }

    //点赞评论
    @PostMapping("/comment")
    public Result commentLike(@RequestParam Integer commentId,
                             @RequestHeader String uid) {
        Long userId = Long.parseLong(uid);
        return likeService.commentLike(userId, commentId);
    }
}
